﻿using UnityEngine;
using System.Collections;
using evt;

public class MenuButtons : MonoBehaviour {

	// Use this for initialization
	void Start () {
		gameObject.name = "MenuButtons";
		EventTriggerListener.Get (transform.GetChild (0).gameObject).onClick = ClickRecordView;
		EventTriggerListener.Get (transform.GetChild (1).gameObject).onClick = ClickMethodView;
		EventTriggerListener.Get (transform.GetChild (2).gameObject).onClick = ClickInstallView;
		EventTriggerListener.Get (transform.GetChild (3).gameObject).onClick = ClickShares;
		EventTriggerListener.Get (transform.GetChild (4).gameObject).onClick = ClickShop;
	}

	private void ClickRecordView(GameObject go){
		SoundPlayer.play ("7571");
		ServerEventDispather.getInstance ().Add (ServerEvent.SHOW_RECROD, null);
	}

	private void ClickMethodView(GameObject go){
		SoundPlayer.play ("7571");
		ServerEventDispather.getInstance ().Add (ServerEvent.SHOW_METHOD_VIEW, null);
	}

	private void ClickInstallView(GameObject go){
		SoundPlayer.play ("7571");
		ServerEventDispather.getInstance ().Add (ServerEvent.OPEN_SETUP_VIEW, null);
	}

	private void ClickShares(GameObject go){
		SoundPlayer.play ("7571");
		GameObject.Find("Main_ca").GetComponent<Demo> ().doWeiChatShareFor4 ();
	}

	private void ClickShop(GameObject go){
		SoundPlayer.play ("7571");
		ServerEventDispather.getInstance ().Add(ServerEvent.OPEN_RECHARGE_VIEW, null);
	}

	// Update is called once per frame
	void Update () {
	
	}
}
